/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.nct.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.nct.model.entities.Chude;
import org.nct.model.entities.Tacgia;
import org.nct.model.entities.Tintuc;

/**
 *
 * @author haott
 */
public class main {

    public static void main(String[] args) {
        chuDeProvider _cdProvider = new chuDeProvider();
        tinTucProvider _ttProvider = new tinTucProvider();
        tacGiaProvider _tacGiaProvider = new tacGiaProvider();

        // select all
        //List<Object> cdlist = _cdProvider.SelectAll();
        //System.out.println(((Chude) cdlist.get(15)).getTenchude()); // thu tu 15 trong list
        // select one
        //Chude _c = (Chude) _cdProvider.SelectOne(5); // ID = 5 
        //System.out.println(_c.getTenchude());
        // public int Insert(Object obj);
        //Chude _c1 = new Chude(120, "CUOI CUOI");
        //System.out.println(_cdProvider.Insert(_c1));
        //public int Update(Object id, Object obj);
        //_c1.setTenchude("KHONG CUOI");
        //System.out.println(_cdProvider.Update(120, _c1));
        //public int Delete(Object id);
        //System.out.println(_cdProvider.Delete(_c1.getId()));
        //public int getMaxID();
        //System.out.println(_cdProvider.getMaxID());
        //public int increase(Object obj);
        //System.out.println(_cdProvider.increase(_c1));
        //DateTime ngayTao = new DateTime();
//        Date dt = new Date();
//        java.text.SimpleDateFormat sdf
//                = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//
//        String currentTime = sdf.format(dt);
//
//        Tintuc tt2 = new Tintuc(
//                101, "HINH DAI DIEN".getBytes(),
//                "TUA DE 111111  est tintuc 1", "MO TA 111111 test test test",
//                "NOI DUNG 11111111111 test va viet 1 bai bao that dai",
//                true, currentTime, currentTime, true);
//        tt2.setIdTacgia(new Tacgia(3));
//
//        List<Tintuc> tttemp = new ArrayList<>();
//        tttemp.add(tt2);
//        
//        Chude cd2 = new Chude(2, "Góc nhìn");
//        cd2.setTintucList(tttemp);
//        
//        List<Chude> lstChuDe2 = new ArrayList<Chude>();
//        lstChuDe2.add(cd2);
//
//        tt2.setChudeList(lstChuDe2);
//        
//        _ttProvider.Update(100, tt2);
//        
//        //_ttProvider.Insert(tt2);
//        
//        _ttProvider.Delete(tt2.getId());
                
        tacGiaProvider _tgProvider = new tacGiaProvider();
        Tacgia tg =  new Tacgia(102);
        tg.setHoten("HAO1111");
        tg.setTuoi(344);
        tg.setButdanh("KHONG CO GI KHO11111");
        tg.setGioitinh(true);
        tg.setDiachi("PHAM DINH HO, P2, Q6111111111");
        tg.setEmail("tieutuanhao@gmail.com11111111");
        tg.setDienthoai("0908.22.49461111111");

        //_tgProvider.Insert(tg);
        
        //_tgProvider.Delete(101);
        _tgProvider.Update(102, tg);
        
    }
}
